<template>
  <div class="dropBox" v-show="flag">
    <van-icon name="clock" color="#FFDD00" />
    <van-count-down
      @finish="finish"
      style="font-size: 11px; color: #fff; font-weight: bold"
      :time="durationTimes"
      format="HH 时 mm 分 ss 秒"
    />
  </div>
</template>

<script>
export default {
  props: ["durationTimes"],
  name: "dropTimer",
  watch: {
    flag: {
      handler(newValue, oldValue) {},
      deep: true,
    },
  },
  data() {
    return {
      time: 0.02 * 60 * 60 * 1000,
      flag: false,
    };
  },
  methods: {
    //倒计时结束 ： 熊猫 已吃完
    finish() {
      localStorage.removeItem("start");
      console.log("结束");
    },
  },
};
</script>

<style scoped>
.dropBox {
  width: 125px;
  height: 19px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  background-color: #fe5c2a;
  border-radius: 11px;
}
</style>
